<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        let obj = {
            a:1,
            b:2,
            c:3,
            d:4,
            e:5
        }

        // 1. 浅拷贝  展开运算符
        // let obj1 = {...obj};

        // console.log(obj1)

        let query = {
            a:"edf",
            d:"abc"
        }

        // let params = {
        //     uname:"张三",
        //     age:18
        // }

        // obj = {...obj,...query};

        // 2. 浅拷贝  JSON
        // let obj1 = JSON.stringify(obj);
        // // console.log(  obj1)
        // obj1 = JSON.parse(obj1);

        //3.  Object.assign()    合并对象  浅拷贝
        // let obj1 = {}; 
        // Object.assign(obj1,obj,params);

        //  let obj1 = {};
        // Object.assign(obj1,obj,query);

        // Object.assign(obj,query,{a:1,b:2,c:3});

        obj = {...obj,...query,a:1,b:2,c:3};

    







    </script>
</body>
</html>